package Model;

/**
 * Created with IntelliJ IDEA.
 * User: Женя
 * Date: 03.11.13
 * Time: 19:18
 * To change this template use File | Settings | File Templates.
 */
public class Director {
    private String name;
    private String surname;
    private String middleName;
    private License license;

    public Director() {
    }

    public Director(String name, String surname, String middleName, License license) {
        this.name = name;
        this.surname = surname;
        this.middleName = middleName;
        this.license = license;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public String getMiddleName() {
        return middleName;
    }

    public void setMiddleName(String middleName) {
        this.middleName = middleName;
    }

    public License getLicense() {
        return license;
    }

    public void setLicense(License license) {
        this.license = license;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Director director = (Director) o;

        if (license != null ? !license.equals(director.license) : director.license != null) return false;
        if (middleName != null ? !middleName.equals(director.middleName) : director.middleName != null) return false;
        if (name != null ? !name.equals(director.name) : director.name != null) return false;
        if (surname != null ? !surname.equals(director.surname) : director.surname != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (surname != null ? surname.hashCode() : 0);
        result = 31 * result + (middleName != null ? middleName.hashCode() : 0);
        result = 31 * result + (license != null ? license.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Director{" +
                "name='" + name + '\'' +
                ", surname='" + surname + '\'' +
                ", middleName='" + middleName + '\'' +
                ", license=" + license +
                '}';
    }
}
